<style>
  .loader-base {
    background-color: rgba(0, 0, 0, 0.55);
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999999;
  }

  .loader-wrap {
    color: rgba(255, 255, 255, 0.65);
    font-size: 45px;
    overflow: hidden;
    width: 1em;
    height: 1em;
    border-radius: 50%;
    position: fixed;
    top: 50%;
    left: 50%;
    margin: -0.5em 0 0 -0.5em;
    /* -webkit-transform: translateZ(0); */
    -ms-transform: translateZ(0);
    /* transform: translateZ(0); */
    -webkit-animation: load6 1.7s infinite ease;
    animation: load6 1.7s infinite ease;
    z-index: 100;
  }

  @-webkit-keyframes load6 {
    0% {
      -webkit-transform: rotate(0deg);
      transform: rotate(0deg);
      box-shadow: 0 -0.83em 0 -0.4em, 0 -0.83em 0 -0.42em, 0 -0.83em 0 -0.44em, 0 -0.83em 0 -0.46em, 0 -0.83em 0 -0.477em;
    }
    5%,
    95% {
      box-shadow: 0 -0.83em 0 -0.4em, 0 -0.83em 0 -0.42em, 0 -0.83em 0 -0.44em, 0 -0.83em 0 -0.46em, 0 -0.83em 0 -0.477em;
    }
    10%,
    59% {
      box-shadow: 0 -0.83em 0 -0.4em, -0.087em -0.825em 0 -0.42em, -0.173em -0.812em 0 -0.44em, -0.256em -0.789em 0 -0.46em, -0.297em -0.775em 0 -0.477em;
    }
    20% {
      box-shadow: 0 -0.83em 0 -0.4em, -0.338em -0.758em 0 -0.42em, -0.555em -0.617em 0 -0.44em, -0.671em -0.488em 0 -0.46em, -0.749em -0.34em 0 -0.477em;
    }
    38% {
      box-shadow: 0 -0.83em 0 -0.4em, -0.377em -0.74em 0 -0.42em, -0.645em -0.522em 0 -0.44em, -0.775em -0.297em 0 -0.46em, -0.82em -0.09em 0 -0.477em;
    }
    100% {
      -webkit-transform: rotate(360deg);
      transform: rotate(360deg);
      box-shadow: 0 -0.83em 0 -0.4em, 0 -0.83em 0 -0.42em, 0 -0.83em 0 -0.44em, 0 -0.83em 0 -0.46em, 0 -0.83em 0 -0.477em;
    }
  }

  @keyframes load6 {
    0% {
      -webkit-transform: rotate(0deg);
      transform: rotate(0deg);
      box-shadow: 0 -0.83em 0 -0.4em, 0 -0.83em 0 -0.42em, 0 -0.83em 0 -0.44em, 0 -0.83em 0 -0.46em, 0 -0.83em 0 -0.477em;
    }
    5%,
    95% {
      box-shadow: 0 -0.83em 0 -0.4em, 0 -0.83em 0 -0.42em, 0 -0.83em 0 -0.44em, 0 -0.83em 0 -0.46em, 0 -0.83em 0 -0.477em;
    }
    10%,
    59% {
      box-shadow: 0 -0.83em 0 -0.4em, -0.087em -0.825em 0 -0.42em, -0.173em -0.812em 0 -0.44em, -0.256em -0.789em 0 -0.46em, -0.297em -0.775em 0 -0.477em;
    }
    20% {
      box-shadow: 0 -0.83em 0 -0.4em, -0.338em -0.758em 0 -0.42em, -0.555em -0.617em 0 -0.44em, -0.671em -0.488em 0 -0.46em, -0.749em -0.34em 0 -0.477em;
    }
    38% {
      box-shadow: 0 -0.83em 0 -0.4em, -0.377em -0.74em 0 -0.42em, -0.645em -0.522em 0 -0.44em, -0.775em -0.297em 0 -0.46em, -0.82em -0.09em 0 -0.477em;
    }
    100% {
      -webkit-transform: rotate(360deg);
      transform: rotate(360deg);
      box-shadow: 0 -0.83em 0 -0.4em, 0 -0.83em 0 -0.42em, 0 -0.83em 0 -0.44em, 0 -0.83em 0 -0.46em, 0 -0.83em 0 -0.477em;
    }
  }
</style>

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta name="applicable-device" content="mobile">
  <meta name="viewport"
        content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no,user-scalable=no">
  <meta name="format-detection" content="telephone=no,email=no,adress=no">
  <meta name="msapplication-tap-highlight" content="no">
  <title>YLBBTITLE</title>
</head>
<body ontouchstart>
<div class="loader-base">
  <div class="loader-wrap"></div>
</div>
</body>
</html>

<script>
  function ajax() {
    var ajaxData = {
      type: arguments[0].type || "GET",
      url: arguments[0].url || "",
      async: arguments[0].async || "true",
      data: arguments[0].data || null,
      dataType: arguments[0].dataType || "text",
      contentType: arguments[0].contentType || "application/x-www-form-urlencoded",
      beforeSend: arguments[0].beforeSend || function () {
      },
      success: arguments[0].success || function () {
      },
      error: arguments[0].error || function () {
      }
    }
    ajaxData.beforeSend()
    var xhr = createxmlHttpRequest();
    xhr.responseType = ajaxData.dataType;
    xhr.open(ajaxData.type, ajaxData.url, ajaxData.async);
    xhr.setRequestHeader("Content-Type", ajaxData.contentType);
    xhr.send(convertData(ajaxData.data));
    xhr.onreadystatechange = function () {
      if (xhr.readyState == 4) {
        if (xhr.status == 200) {
          ajaxData.success(xhr.response)
        } else {
          ajaxData.error()
        }
      }
    }
  }

  function createxmlHttpRequest() {
    if (window.ActiveXObject) {
      return new ActiveXObject("Microsoft.XMLHTTP");
    } else if (window.XMLHttpRequest) {
      return new XMLHttpRequest();
    }
  }

  function convertData(data) {
    if (typeof data === 'object') {
      var convertResult = "";
      for (var c in data) {
        convertResult += c + "=" + data[c] + "&";
      }
      convertResult = convertResult.substring(0, convertResult.length - 1)
      return convertResult;
    } else {
      return data;
    }
  }


  var URL = 'http://' + window.location.host + '/orgRedirect.html';
  // window.location.href = URL;
  var params = {
    url: URL,
  };

  ajax({
    type: "POST",
    url: "http://wx.yilaibaobei.com:6600/api/invoke/GetOAuth",
    dataType: "json",
    data: params,
    beforeSend: function () {
    },
    success: function (msg) {
      if (msg.IsSuccess) {
        window.location.href = msg.ErrorMessage;
        window.event.returnValue = false;
      } else {
        alert('服务器连接失败！');
      }
    },
    error: function (e) {
      console.log(e);
      alert('服务器连接失败！');
    }
  })
</script>
